#ifndef __INFO_COLLECT_MGR_H__
#define __INFO_COLLECT_MGR_H__

#include <wx/wx.h>
#include <wx/socket.h>
#include <string>

enum
{
	wxID_MainInfoSpace = 3000,
	wxID_Server,
	wxID_Socket,
};

#include <vector>
typedef std::vector<std::string> BuildInfoList;
#include <list>
typedef std::list<std::string> ReportInfoList;


class InfoCollectMgr :public wxThread,public wxEvtHandler
{
public:
    InfoCollectMgr();
	unsigned short startListen(void);
	void daemonApplicationNative(const std::string &name, const std::string &param);
	void getTopReport( ReportInfoList & report);
protected:
    virtual void *Entry();
private:
	void recievReport(const string &report);
	void parseReportAction(const string &cmd);
	void parseReportResult(const string &log);
private:
	wxSocketServer *m_server;
	wxUint32 m_RecievSize;
	bool m_Run;
	wxMutex m_Mutex;
	wxCondition m_Cond;
	BuildInfoList m_BuildInfo;
	BuildInfoList m_ViewInfo;
	int m_ShowCouter;

private:
	void OnServerEvent(wxSocketEvent& evt);
	void OnSocketEvent(wxSocketEvent& evt);
	DECLARE_EVENT_TABLE()
};


#endif // __INFO_COLLECT_MGR_H__